package com.ndp.fb.rdb.db.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.ndp.fb.rdb.api.ChangeHistoryRdbService;
import com.ndp.fb.rdb.db.DaoTemplate;
import com.ndp.fb.rdb.db.impl.mapper.DefaultRowMapper;
import com.ndp.fb.rdb.model.ChangeAccountHistory;

import java.util.List;

/**
 * Created by Elvis on 2015/4/22.
 */
@Service
public class ChangeHistoryRdbServiceImpl extends DaoTemplate implements ChangeHistoryRdbService {

    @Override
    public List<ChangeAccountHistory> findAll() {
        StringBuilder sql = new StringBuilder();
        sql.append("select * from changehistory");
        return getJdbcTemplate().query(sql.toString(), DefaultRowMapper.autoRowMapper(ChangeAccountHistory.class));
    }

    @Override
    public void save(ChangeAccountHistory changeAccountHistory) {
        saveResultId(changeAccountHistory);
    }
}
